#ifndef SYSTEM_H
#define SYSTEM_H

//#include <QtOpenGL>
#include <GL/gl.h>
#include <vector>

#include "qr.h"
#include "matrix.h"

class System{
	public:
		System(unsigned int);
		~System();
		
		void setAlpha(double);
		double getAlpha(unsigned int);
		void setGamma(double);
		double getGamma(unsigned int);
		
		void setMode(unsigned int);
		unsigned int getMode();
		
		unsigned int getTotalModes();
		
		void calculeVibrationMode(double);
		
		virtual void calculate(unsigned int) = 0;
		virtual void initialPosition() = 0;
		virtual void draw() const = 0;
	
	protected:
		virtual void populateK(Matrix&) = 0;
		virtual void populateM(Matrix&) = 0;
		
		void sort(int, int);
		
		double getW(unsigned int);
		double getU(unsigned int, unsigned int);
		
		std::vector<double> alphas;
		std::vector<double> gammas;
		
		Matrix *lambda, *x;
		
		unsigned int currentMode;
		unsigned int totalModes;
};

#endif
